import React from "react";
import {Input} from 'antd';
import "./index.css"

/**
 * @author: RenLishisan
 * @description: 该组件为搜索组件
 * @time: 2020/10/23
 **/
const {Search: Index} = Input;

class Search extends React.Component {
    /**
     * @author: RenLishisan
     * @description: 把用户输入的数据传递给upDateSource
     * @param: value
     * @return: upDataSource
     * @time: 2020/10/27
     **/
    onSearch = (value) => {
        this.props.upDataSource(value)
    };

    render() {
        return (
            // 引用AntD搜索组件
            <Index placeholder="点击搜索商品" onSearch={this.onSearch}/>
        )
    }
}

export default Search;
